var a = [1, 2, 3, 4, 5]
console.log("array:" + a);
console.log("forEach:");
a.forEach(function (x, index, a) {
    console.log(x + '|' + index + "|" + a);

});
console.log();

console.log("array:" + a);
console.log("map:" + a.map((x) => x + 10));
console.log("array_map:" + a);
console.log();
a=[1,2,3,4,5,6,7,8,9,10]
console.log("array:" + a);
console.log(a.filter((x,index)=>index%3===0||x>=8));
console.log("filter_array:" + a);
console.log();
console.log("array:" + a);
console.log("every"+a.every((x)=>x<8));
console.log("array:" + a);
console.log("some:"+a.some((x)=>x<10));
console.log();
a=[1,2,3]
var sum=a.reduce((x,y)=>x+y,0)
console.log("sum:"+sum);
console.log();
a=[1,2,3,2,1]
console.log("array:" + a);
console.log("indexOf:"+a.indexOf(2));
console.log();console.log("array:" + a);
console.log("indexOf:"+a.indexOf(3));
console.log();console.log("array:" + a);
console.log("indexOf:"+a.indexOf(5));
console.log();
a=[1,2,3,4,5,4,3,2,1]
console.log("array:" + a);
console.log("LastIndexOf:"+a.lastIndexOf(2));
console.log("LastIndexOf:"+a.lastIndexOf(3));
console.log("LastIndexOf:"+a.lastIndexOf(3,8));
console.log();
console.log("isArray:"+Array.isArray(a));
console.log(a instanceof Array);
console.log(a.constructor===Array);
console.log(Object.prototype.toString.apply(a)==='[object Array]');







    



